program FRASE;

uses CRT;

VAR
    texto: STRING;
    I: INTEGER;

BEGIN
    clrscr;
    READ(texto);


    I := length( texto );
    repeat
        writeln( texto[i] );
        i := i - 1;
    until i = 0;
    readkey;

    FOR I := length( texto ) downto 0 do
        WRITELN( texto[I] );

    READKEY;


END.

